package com.mall.common.valid;



//import jakarta.validation.Constraint;
//import jakarta.validation.Payload;
import javax.validation.Constraint;
import javax.validation.Payload;

import java.lang.annotation.*;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 自定义校验注解
 * 输入值需满足输入的值
 * --------------------------------
 * 血的教训-切记
 * --------------------------------
 * 注意：导入的包要正确一定是这俩：javax
 * import javax.validation.Constraint;
 * import javax.validation.Payload;
 * --------------------------------
 * 千万别导错了,这俩不生效有问题：jakarta
 * import jakarta.validation.Constraint;
 * import jakarta.validation.Payload;
 */


@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE , TYPE })
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = { ListValueConstraintValidator.class })
public @interface ListValue {
    String message() default "数据值异常,非正常值";

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };

    int[] value() default { };

}
